<template>
    <div>
        <!--        列表-->
        <el-table
                :data="tableData"
                border
                width="100%"
        >
            <el-table-column
                    prop="objective"
                    label="实际目的"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="mynum"
                    label="满意"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="ybnum"
                    label="一般"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="bmynum"
                    label="不满意"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="sum"
                    label="总数"
                    align="center"
            >
                <template slot-scope="scope">
                    {{scope.row.sum = scope.row.mynum + scope.row.ybnum + scope.row.bmynum }}
                </template>
            </el-table-column>
            <el-table-column
                    prop="favorableRate"
                    label="好评率"
                    align="center"
            >
                <template slot-scope="scope">
                    {{(scope.row.favorableRate =(scope.row.mynum / scope.row.sum)*100 ).toFixed(1)}}%
                </template>
            </el-table-column>
        </el-table>

    </div>
</template>

<script>


    export default {

        data() {
            return {
                tableData: [],
            }
        },

        props: {},

        components: {},

        computed: {},

        methods: {
            async init() {
                const res = await this.$http('evaluatestatisticslist', {})
                this.tableData = res
                console.log(res)
            }
        },

        watch: {},

        mounted() {
            this.init();
        },

    }
</script>

<style scoped>

</style>
